/* UserMenu.module.css */
/* 头像容器及头像样式 */
.userIcon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 2;
    position: relative;
}

/* 头像外层容器 */
.avatar-wrapper {
    position: relative;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    transition: all 0.3s ease;

    /* 基础边框 */
    background: linear-gradient(45deg, #6495ed, #8a2be2);
    padding: 1px;
}

/* 头像悬停或菜单打开时的样式 */
.avatar-hover {
    transform: scale(1.05);
}

/* 科技感发光效果 */
.avatar-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(138, 43, 226, 0);
    transition: box-shadow 0.3s ease;
    z-index: 1;
}

.avatar-hover .avatar-glow {
    box-shadow: 0 0 12px rgba(138, 43, 226, 0.6);
}

/* 触发下拉的容器基础样式 */
.user-menu-container {
    position: relative;
    display: inline-block;
}

/* 下拉菜单整体样式 */
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 220px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    overflow: hidden;
    animation: fadeInUp 0.2s ease-out;
}

/* 菜单项列表样式，重置默认列表样式 */
.user-menu-container ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 单个菜单项样式 */
.user-menu-container li {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.user-menu-container li:hover {
    background-color: rgba(241, 245, 249, 0.7);
    transform: translateX(2px);
}

/* 菜单项图标样式 */
.user-menu-container li span:first-child {
    margin-right: 12px;
    color: #6b7280;
    width: 16px;
    text-align: center;
}

/* 退出登录项样式 */
.logout-item {
    border-top: 1px solid rgba(204, 204, 204, 0.3);
    margin-top: 4px;
    padding-top: 8px;
    color: #e53e3e;
}

.user-menu-collect {
    width: 16px;
    height: 16px;
}

/* 下拉菜单出现的动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 清除移动端点击时的默认高亮效果 */
.user-menu-container * {
    -webkit-tap-highlight-color: transparent;
}

/* 清除移动端按钮等元素的默认圆角和阴影 */
.user-menu-container button,
.user-menu-container input,
.user-menu-container select,
.user-menu-container textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0;
    outline: none;
}

/* 退出成功提示样式 */
.logout-message {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #00B42A;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.3s, fadeOut 0.3s 2.7s;
    z-index: 10;
}

.success-icon {
    color: white;
    font-size: 16px;
}

/* 菜单图标样式 */
.menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.icon-wrapper {
    margin-right: 8px;
}

/* 菜单项样式优化 */
.menu-item {
    padding: 8px 16px;
    transition: background-color 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translate(-50%, 0); }
    to { opacity: 0; transform: translate(-50%, -10px); }
}

/* 模态框背景 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

/* 模态框容器 */
.modal-container {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-in-out;
}

/* 模态框头部 */
.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-icon {
    color: #ff5252;
    font-size: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* 模态框主体 */
.modal-body {
    padding: 20px;
}

.modal-body p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

/* 模态框底部 */
.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 按钮样式 */
.modal-btn {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.cancel-btn {
    background-color: #f5f5f5;
    color: #333;
}

.cancel-btn:hover {
    background-color: #e0e0e0;
}

.confirm-btn {
    background-color: #ff5252;
    color: white;
}

.confirm-btn:hover {
    background-color: #ff3b3b;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
